import qs from "qs"
import request from "@/request/request";
// 精品推荐
export const JingPinAPI = () => request.get("/products/recommend");
export const SendSMSAPI = (params) => request.post("/sendSMS", qs.stringify(params));
//登录请求
export const PhoneReginAPI = (params) => request.post("/phoneRegin", qs.stringify(params))
    // 微信扫码登录请求
export const WeiXinLoginAPI = (params) => request.post("/wechatUsers/PCLogin", qs.stringify(params))
    // 手机关联微信
export const BindingAPI = (params) => request.post("/wechatUsers/binding", qs.stringify(params))
    // 获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles")
    // 热门兑换
export const HotAPI = () => request.get("/products/hot")
    // 商品详情
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`)
    // 加入到购物车
export const CartsAddAPI = (params) => request.post("/shop/carts/add", qs.stringify(params));
// 商品搜索（含首页的“更多”）
export const GoodsSearchApi = (params) => request.get(`/products`, { params });
// 查看购物车
export const ShopCartsAPI = () => request.get("/shop/carts")

export const DeleteCartsAPI = (id) => request.delete(`/shop/carts?productIds=${id}`)
    // console.log(
    //     "qs.stringify:",
    //     qs.stringify({ phone: "15718312102", name: "zhangsan" })
    // );